import { ActionType, ProForm, ProFormSelect, ProFormTextArea } from '@ant-design/pro-components';
import { Divider, Modal } from 'antd';

interface Iprops {
  isShowModal1: (show: boolean) => void;
  isModalOpen1: boolean;
  actionRef1: React.MutableRefObject<ActionType | undefined>;
}
const AddRemote = (props: Iprops) => {
  const { isModalOpen1, isShowModal1, actionRef1 } = props;
  return (
    <Modal
      title="新增远程指导"
      centered
      open={isModalOpen1}
      onCancel={() => isShowModal1(false)}
      width={500}
      footer={null}
    >
      <Divider />
      <ProForm<{
        yisheng: string;
        huanzhe: string;
        reason: string;
      }>
        onReset={() => isShowModal1(false)}
        //   onFinish={(value) => {
        //     // return console.log(value);
        //   }}
        submitter={{
          // 配置按钮文本
          searchConfig: {
            resetText: '取消',
            submitText: '确定',
          },
          resetButtonProps: {
            style: {
              display: 'block',
              position: 'absolute',
              left: 'calc(50% - 107px)',
            },
          },
          submitButtonProps: {
            style: {
              display: 'block',
              position: 'absolute',
              right: 'calc(50% - 107px)',
            },
          },
        }}
      >
        <ProFormSelect
          name="yisheng"
          label="指导机构"
          request={async () => [
            { label: '全部', value: 'all' },
            { label: '未解决', value: 'open' },
            { label: '已解决', value: 'closed' },
            { label: '解决中', value: 'processing' },
          ]}
          placeholder="请选择指导机构"
          rules={[{ required: true, message: '请选择指导机构' }]}
        />
        <ProFormSelect
          name="huanzhe"
          label="患者"
          request={async () => [
            { label: '全部', value: 'all' },
            { label: '未解决', value: 'open' },
            { label: '已解决', value: 'closed' },
            { label: '解决中', value: 'processing' },
          ]}
          placeholder="请选择患者"
          rules={[{ required: true, message: '请选择患者' }]}
        />
        <ProFormTextArea name="reason" label="备注" placeholder="" />
        <br />
      </ProForm>
      <br />
    </Modal>
  );
};
export default AddRemote;
